<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>提现记录</title>
    <link rel="stylesheet" type="text/css" href="css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/loading.css"/>
    <link rel="stylesheet" type="text/css" href="css/base.css"/>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
      <script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    	$(window).load(function(){
    		$(".loading").addClass("loader-chanage")
    		$(".loading").fadeOut(300)
    	})
//  	function init()
//			{
//				var  yanzhengma = window.prompt("请输入密码", "");
//				if( yanzhengma == "123" ){
//////					location.href = "/index.html";
//					
//					alert("提现成功！");
//					return true;
//				}
//				else{
//					alert("密码错误,请重新输入");
//				}
//			}
$(".buy-confirm").on("click", function () {
                // 打开支付密码对话框并生成订单
                $('.pay-part').css("display", "block");
            })
            $(".cancel-btn").on("click", function () {
                $('.pay-part').css("display", "none");
                $inputs.each(function () {  //input清空
                    $(this).val("");
                })
                pwd = "";
                $(".real-ipt").val("");
            })
            $(".confirm-btn").on("click", function () {
                console.log("password:" + pwd);
                if (len === 6 && pwd) {     //付款
 
                    // $.toast("密码错误")
                    window.location.href = 'activity_buy_result.html'
 
                } else {
                    $.toast("请输入支付密码")
                }
            })
 
            var pwd = "";
            var len = 0;
            // type=tel input框
            var $inputs = $(".surface-ipt input");
            $(".real-ipt").on("input", function () {
                if (!$(this).val()) {   //无值
                }
                if (/^[0-9]*$/g.test($(this).val())) {  //有值且只能是数字（正则）
                    pwd = $(this).val().trim();
                    len = pwd.length;
                    for (var i in pwd) {
                        $inputs.eq(i).val(pwd[i]);
                    }
                    $inputs.each(function () {  //将有值的当前input 后面的所有input清空
                        var index = $(this).index();
                        if (index >= len) {
                            $(this).val("");
                        }
                    })
                    if (len === 6) {
                        //执行付款操作
                    }
 
                } else {    //清除val中的非数字，返回纯number的value
                    var arr = $(this).val().match(/\d/g);
                    try {
                        $(this).val($(this).val().slice(0,$(this).val().lastIndexOf(arr[arr.length-1])+1));
                    } catch(e) {
                        // console.log(e.message)
                        //清空
                        $(this).val("");
                    }
                }
                console.log("password:" + pwd);
            })
            //  获取焦点事件避免输入键盘挡住对话框
            $('.real-ipt').on('focus', function () {
                $('.pay-dialog').css('top','1rem')
            })
            $('.real-ipt').on('blur', function () {
                $('.pay-dialog').css('top','3rem')
			})
    </script>
    
    <style>
    	body{
    		background-color: wheat;
    	}
    	.F_button{
    		margin-top:60px ;
    		padding: 5px 60px 5px;
    		box-shadow: orange 0 0 10px;
    		color:white;
    		border-radius: 10px;
    		background-color: rgba(0,0,0,0.2);
    		font-size: 13px;
    	}
    	.F_text{
    		width:200px; height: 40px;
    		text-align: center;
    		/*border:red solid 1px;*/
    		font-size: 15px;
    		line-height: 20px;
    		border-radius: 30px;
    		box-shadow: orange 0 0 30px;     		
    	}
    	.F_button:active{
    		background-color: transparent;
    		border-color: transparent;
    		
    	}
    	.F_button:visited{
    		box-shadow: orange 0 0 30px;     	
    	}
    	.F_button:after{
    		box-shadow: orange 0 0 30px;     	
    	}
    	.common-part{
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    background-color: #000000;
    /*父块透明，子块不透明，用rgba*/
    background: rgba(0,0,0,0.3);
	}
	.common-dialog{
	    width: 7.2rem;
	    text-align: center;
	    position: absolute;
	    background: #ffffff;
	    z-index: 2;
	    opacity: 1;
	    border-radius: .1rem;
	    border: 1px solid #f2f2f2;
	    left: calc(50% - 3.6rem);
	    left: -moz-calc(50% - 3.6rem);
	    left: -webkit-calc(50% - 3.6rem);
	    top: 3rem;
	}
	.pay-part{
	    display: none;
	}
	.pay-dialog{
	    height: 6.9rem;
	}
	.dialog-title{
	    height: 1.5rem;
	    line-height: 1.5rem;
	    color: #333333;
	    font-size: .48rem;
	    border-bottom: 1px solid #f2f2f2;
	}
	.pay-money{
	    color: #333333;
	    font-size: .6rem;
	    margin: .6rem 0;
	    font-weight: bold;
	}
	.pay-password{
	    width: 6.6rem;
	    height: 1.2rem;
	    border: 1px solid #999999;
	    margin: 0 auto;
	    position: relative;
	}
	.pay-password .real-ipt{
	    position: absolute;
	    top: 0;
	    left: 0;
	    width: 100%;
	    height: 1.2rem;
	    line-height: 1.2rem;
	    opacity: 0;
	    z-index: 3;
	}
	.pay-password .surface-ipts{
	    position: absolute;
	    top: 0;
	    left: 0;
	    width: 100%;
	    height: 1.2rem;
	    line-height: 1.2rem;
	    z-index: 1;
	    overflow: hidden;
	}
	.pay-password .surface-ipts .surface-ipt{
	    height: 1.2rem;
	    line-height: 1.2rem;
	    display: flex;
	    justify-content: space-between;
	}
	.pay-password .surface-ipts .surface-ipt input{
	    width: 1.1rem;
	    height: 1.12rem;
	    line-height: 1.12rem;
	    border: 0;
	    border-right: 1px solid #999999;
	    color: #333333;
	    font-size: .9rem;
	    text-align: center;
	    padding: 0;
	}
	.pay-part .btns{
	    margin: .48rem 0;
	}
	.cancel-btn{
	    width: 3rem;
	    height: 1.2rem;
	    line-height: 1.2rem;
	    background: url("../res/h5tel_btn_blueline_300x120.png") center no-repeat;
	    background-size: 100%;
	    color: #2ea7e0;
	    font-size: .42rem;
	    border: none;
	}
	.confirm-btn{
	    width: 3rem;
	    height: 1.2rem;
	    line-height: 1.2rem;
	    background: url("../res/h5tel_btn_blue_300x120.png") center no-repeat;
	    background-size: 100%;
	    color: #ffffff;
	    font-size: .42rem;
	    border: none;
	    margin-left: .6rem;
	}
    </style>
</head>
<!--loading页开始-->
<div class="loading">
	<div class="loader">
        <div class="loader-inner pacman">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
	</div>
</div>
<!--loading页结束-->
<body>
	<header class="top-header fixed-header">
		<a class="icona" href="javascript:history.go(-1)">
				<img src="images/back.jpg"/>
			</a>
		<h3>我要提现</h3>
			
			<a class="iconb" href="#">
			</a>
	</header>
	
	<div class="T_div" align="center" style="margin-top: 30%; ">
		<form action="" method="post">
			<marquee style="margin-bottom: 30px; color: black;" onmouseover="this.stop()" onmouseout="this.start()"><h2>可算是提现了！！！</h2></marquee>
			
			<input type="text" value="" class="F_text" placeholder="请输入要提现的金额"/ style="border-radius: 10px;" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-.]+/,'');}).call(this)" onblur="this.v();" maxlength="10">
			
			<br />
			<br />
			<br />
			<br />
			<br />
			
			
			<input type="submit" id="click" value="提现"  class="F_button" style="border-radius: 10px;"/><br />
			
		</form>
		
	</div>
	
	<div class="common-part pay-part">
        <div class="common-dialog pay-dialog">
            <div class="dialog-title">请输入密码</div>
            <!--<div class="pay-money">$10000.00</div>-->
            <div class="pay-password">
                <input type="tel" maxlength="6" class="real-ipt">
                <div class="surface-ipts">
                    <div class="surface-ipt">
                        <input type="password" >
                        <input type="password" >
                        <input type="password" >
                        <input type="password" >
                        <input type="password" >
                        <input type="password" >
                    </div>
                </div>
            </div>
            <div class="btns">
                <button class="cancel-btn">取消</button>
                <button class="confirm-btn">确认</button>
            </div>
        </div>
	</div>

</body>
</html>